package com.happyhome.services;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.happyhome.dao.DistrictDao;
import com.happyhome.datamodel.District;

@Service
public class DistrictServiceImpl implements DistrictService{
	
	@SuppressWarnings("unused")
	private static final Logger LOGGER = LoggerFactory.getLogger(DistrictServiceImpl.class);
	
	@Autowired
    private DistrictDao districtDao;

	@Override
	public List<District> getDistrictByProvinceCode(String provinceCode) {
		List<District> districts= districtDao.getDistrictByProvinceCode(provinceCode);
		return districts;
	}

	@Override
	public District getDistrictByCode(String code) {
		return districtDao.getDistrictByCode(code);
	}

	public List<District> getAllDistricts(){
		return districtDao.getAllDistricts();
	}
}
